package com.example.androidcoursedesign2012.controller;

import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/okhttp")
public class OkHttpController {
    @RequestMapping(value = "/toJson",method = RequestMethod.POST)
    @PostMapping
    public Map toJson(@RequestBody String requestData){
        System.out.println("请求数据："+requestData);
        Map<String,Object> data=new HashMap<>();
        data.put("code","200");
        data.put("data",requestData);
        return data;
    }
}
